<%@Page Language="VB"%>
<%@ Import Namespace="System.IO" %>


<script runat=server>

	
Sub DoSomethingWithAList( list as ArrayList )

	SyncLock list

		list.Add("abc")

	End SyncLock

End Sub

</script>

<%
'VB


dim Animals as ArrayList = new ArrayList()
dim ArrayOfAnimals() as string

Animals.Add( "Cat" )
Animals.Add( "Dog" )

dim a as Array
dim s as string

ArrayOfAnimals = Array.CreateInstance( GetType(String), 2 )

Animals.CopyTo( ArrayOfAnimals, 0 )
dim Animal as String

For Each Animal in ArrayOfAnimals 
	Response.Write("<P>" + Animal )
Next

dim NotThreadSafeArrayList as ArrayList

NotThreadSafeArrayList = new ArrayList()
NotThreadSafeArrayList.Add("Hello")

dim ThreadSafeArrayList as ArrayList

ThreadSafeArrayList = ArrayList.Synchronized( NotThreadSafeArrayList )

if ThreadSafeArrayList.IsSynchronized = true then
	Response.Write("<P>It's synchronized")
end if
%>



1
<p style="color:red" id=status EnableViewState=False runat=server />
